<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>qesp : main.cpp Example File (examples/qespta/main.cpp)</title>
  <link rel="stylesheet" type="text/css" href="style/style.css" />
</head>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td class="postheader" valign="center"><a href="index.html">Home</a> &middot; <a href="classes.html">All Classes</a> &middot;</td></tr></table><h1 class="title">main.cpp Example File</h1>
<span class="small-subtitle">examples/qespta/main.cpp</span>
<!-- $$$examples/qespta/main.cpp-description -->
<div class="descr"> <a name="details"></a>
<pre class="cpp">    <span class="comment">/**
     * @file main.cpp
     * @brief Main file.
     * @author Micha? Policht
     */</span>

    <span class="preprocessor">#include &lt;QApplication&gt;</span>
    <span class="preprocessor">#include &quot;MainWindow.h&quot;</span>
    <span class="preprocessor">#include &quot;MessageWindow.h&quot;</span>

    <span class="type">int</span> main(<span class="type">int</span> argc<span class="operator">,</span> <span class="type">char</span> <span class="operator">*</span>argv<span class="operator">[</span><span class="operator">]</span>)
    {
        <span class="type"><a href="http://qt-project.org/doc/qt-4.8/qapplication.html">QApplication</a></span> app(argc<span class="operator">,</span> argv);
    <span class="preprocessor">#if QT_VERSION &lt; QT_VERSION_CHECK(5,0,0)</span>
        <span class="comment">//redirect debug messages to the MessageWindow dialog</span>
        <a href="http://qt-project.org/doc/qt-4.8/qtglobal.html#qInstallMsgHandler">qInstallMsgHandler</a>(MessageWindow<span class="operator">::</span>AppendMsgWrapper);
    <span class="preprocessor">#else</span>
        qInstallMessageHandler(MessageWindow<span class="operator">::</span>AppendMsgWrapper);
    <span class="preprocessor">#endif</span>

        MainWindow mainWindow;
        mainWindow<span class="operator">.</span>show();

        <span class="keyword">return</span> app<span class="operator">.</span>exec();
    }</pre>
</div>
<!-- @@@examples/qespta/main.cpp -->
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="40%" align="left">Copyright &copy; 2000-2012</td>
<td width="20%" align="center"><a href="http://code.google.com/p/qextserialport">QextSerialPort Project</a></td>
<td width="40%" align="right"><div align="right">QextSerialPort Manual</div></td>
</tr></table></div></address></body>
</html>
